<style>
    .panel-header, .panel-body {
        border-width: 0px;
    }

    .datagrid, .combo-p {
        border: solid 1px #D4D4D4;
    }

    .panel-title {
        cursor: pointer
    }

    .inlineblock {
        margin-top: 10px;
    }

    .inlineblock div {
        display: inline-block;
    }

    .inlineblock div label {
        display: inline-block;
        top: 5px;
    }

    .newform {
        width: 70%;
    }

    .editform {
        width: 70%;
    }

    .searchClass {
        margin-left: 5%;
        margin-top: 1%;
    }

    .searchClass label {
        width: 9%;
        font-weight: bold;
        text-align: center;
    }

    #Search {
        float: right;
        margin-right: 4%;
        width: 14%;
    }
</style>
<div class="row">
    <div id="breadcrumb" class="col-xs-12" style="margin-bottom: 10px">
        <a href="#" class="show-sidebar"> <i class="fa fa-bars"></i>
        </a>
        <ol class="breadcrumb pull-left">
            <li><a href="#">学生管理</a></li>
            <li><a href="#">学生管理</a></li>
        </ol>
    </div>
</div>
<div class="row">
    <div class="col-xs-12">
        <div class="box">
            <div class="box-header">
                <div class="box-name">
                    <i class="fa fa-clipboard"></i> <span>学生管理</span>
                </div>
                <div class="box-icons">
                    <a class="collapse-link"> <i class="fa fa-chevron-up"></i>
                    </a> <a class="expand-link"> <i class="fa fa-expand"></i>
                </a> <a class="close-link"> <i class="fa fa-times"></i>
                </a>
                </div>
                <div class="no-move"></div>
            </div>
            <div class="box-content table-responsive" style="padding-top: 15px">




                <!--主信息面板 S-->
                <div class="panel panel-default" style="border: 1px solid #CCC;">
                    <div class="panel panel-default" style="border: 1px solid #CCC; height: auto;">
                        <div class="panel-heading" role="tab" id="headingOne">
                            <h4 class="panel-title" data-toggle="collapse" data-target="#collapseForAdd">
                                功能面板 <span class="fa fa-chevron-down" style="float: right"></span>
                            </h4>
                        </div>

                        <div id="collapseForAdd" class="panel-collapse collapse in" role="tabpanel"
                             aria-labelledby="headingOne">
                            <div class="panel-body">
                                <div class="container-fluid" style="margin-top: 20px;">
                                    <!--操作-->
                                    <div id="operationpanel" class="col-xs-12">
                                        <div class="col-xs-12 btn-menu-top-minus">
                                            <button class="btn btn-primary btn-sm addbook">
                                                <i class="fa fa-file-o"></i> 查看学生详情
                                            </button>
                                            <button class="btn btn-primary btn-sm editbook">
                                                <i class="fa fa-file-text"></i> 修改学生信息
                                            </button>
                                            <button class="btn btn-danger btn-sm removebook">
                                                <i class="fa fa-trash-o"></i> 删除
                                            </button>
                                        </div>
                                    </div>

                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="panel-heading" role="tab" id="headingTwo">
                        <h4 class="panel-title" data-toggle="collapse" data-target="#collapseForCourseTable">
                            学生管理<span class="fa fa-chevron-down" style="float: right"></span>
                        </h4>
                    </div>
                    <div id="collapseForCourseTable" class="panel-collapse collapse in" role="tabpanel"
                         aria-labelledby="headingTwo">
                        <div class="panel-body" style="overflow: hidden;">
                            <!--搜索区域-->
                            <div class="searchClass row">
                                <div class="col-xs-12">
                                    <label>昵称</label>
                                    <input class="SearchForm form-control" type="text" id="stu_nickname"/>
                                     <label>手机号</label>
                                    <input class="SearchForm form-control" type="text" id="stu_phone"/>
                                    <label>课程</label>
                                    <select class="SearchForm form-control" id="s_id" style="height:32px;">
                                        <option value="">不限</option>
                                        {volist name='subs' id='s'}
                                        <option value="{$s['s_id']}">{$s['s_name']}</option>
                                        {/volist}
                                    </select>&nbsp;&nbsp;&nbsp;&nbsp;
                                </div>
                            </div>
                            <!--<div class="searchClass row">-->
                                <!--<div class="col-xs-12">-->
                                    <!--<label>日期</label>-->
                                    <!--<input class="SearchForm form-control" type="text" id="start" readonly/>-->
                                    <!--至&nbsp;&nbsp;&nbsp;-->
                                    <!--<input class="SearchForm form-control" type="text" id="end" readonly/>-->
                                <!--</div>-->
                            <!--</div>-->
                            <button id="Search" class="btn btn-primary btn-xs" style="height: 30px;margin-left: 30px">
                                <i class="fa fa-search"></i>&nbsp;&nbsp;搜索
                            </button>
                            <button id="Reset" class="btn btn-primary btn-sm" style="width:120px;float: right;">
                                清空查询条件
                            </button>
                        </div>
                        <table id="datatable_studentinfo" data-size="15" style="width: 100%">
                        </table>
                    </div>
                </div>
                <!--主信息面板 E-->
            </div>
        </div>
    </div>
</div>
<script src="static/js/ajax/studentmanage.js"></script>
<script>
function chooseTeacher(self) {
    var dom = self;
    var stuid = dom.name;
    $.ajax({
        url: 'admin/Student/update_stu_tea_model',
        data: "stu_id=" + stuid,
        type: 'POST',
        dataType: 'HTML', //返回的数据类型
        success: function(updatemodalhtml) {
            content = updatemodalhtml;
            //弹出修改框
            $.TeachDialog({
                modalId: null,
                animation: null,
                title: '指定老师',
                content: content,
                showCloseButton: true,
                showCloseButtonName: '关闭',
                CloseButtonAddFunc: function() {
                },
                otherButtons: ['确定'],
                clickButton: function(sender, modal, index) {
                   // alert($("#updateTeaForm").serialize());return;
                    $.ajax({
                        url: 'admin/Student/update_stu_tea',
                        data: $("#updateTeaForm").serialize(),
                        type: 'POST',
                        dataType: 'JSON',
                        success: function(returnData) {
                            if (returnData.status == 0) {
                                $.TeachDialog({
                                    content: returnData.msg
                                });
                            } else {
                                modal.modal('hide');
                                $.TeachDialog({
                                    content: returnData.msg,
                                    showCloseButton: false,
                                });
                                $('#datatable_studentinfo').datagrid('reload');
                            }
                        },
                        error: function() {
                            $.TeachDialog({
                                content: '修改失败',
                            });
                        },
                    });
                },
            });
        },
        error: function() {
            $.TeachDialog({
                content: '获取数据失败，无法进行修改',
            });
            return;
        }
    });
}
</script>